<template>
	<view>
		<view class="uulist">
			<view class="items">
				<view class="title">退款金额</view>
				<view class="inputs">
					{{price}}
				</view>
			</view>
		</view>
		<view class="uulist">
			<view class="items">
				<view class="title">退款卡号</view>
				<view class="inputs">
					<input v-model="params.account" type="text" placeholder-class="inputTs" placeholder="请输入" />
				</view>
			</view>
		</view>
		<view class="uulist">
			<view class="items">
				<view class="title">户名</view>
				<view class="inputs">
					<input v-model="params.name" type="text" placeholder-class="inputTs" placeholder="请输入" />
				</view>
			</view>
		</view>
		<view class="uulist">
			<view class="items">
				<view class="title">银行名称</view>
				<view class="inputs">
					<input v-model="params.bankName" type="text" placeholder-class="inputTs" placeholder="请输入" />
				</view>
			</view>
		</view>
		<view class="uulist">
			<view class="items">
				<view class="title">开户支行</view>
				<view class="inputs">
					<input v-model="params.bankChildName" type="text" placeholder-class="inputTs" placeholder="请输入" />
				</view>
			</view>
		</view>

		<view class="" style="height: 200rpx;"></view>
		<view class="footer_btn">
			<view class="cont">
				<view class="btn" @click="handleConfirm">
					确认
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserinfo,
		refundApply
	} from '@/common/http.api.js';
	export default {
		data() {
			return {
				params: {
					account: '',
					name: '',
					bankName: '',
					bankChildName: '',
				},
				price: 0
			};
		},
		onLoad() {
			getUserinfo({}).then(res => {
				if (res.code == 200) {
					this.price = res.data.bond
				}
			})
		},
		methods: {
			handleConfirm() {
				if (this.params.account == '' ||
					this.params.name == '' ||
					this.params.bankName == '' ||
					this.params.bankChildName == ''
				) {
					this.$modal.msg('请完整填写信息')
				} else {
					refundApply(this.params).then(res => {
						console.log(res);
						if (res.code == 200) {
							this.$modal.msg('已提交申请')
							setTimeout(() => {
								uni.navigateBack()
							}, 500)
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.inputTs {
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 28rpx;
		color: #D1CDCD;
	}

	.uulist {

		.items {
			width: 690rpx;
			height: 160rpx;
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin: 20rpx auto;
			padding: 20rpx 30rpx;
			box-sizing: border-box;

			.title {
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 32rpx;
				color: #11192D;
			}

			.inputs {
				margin-top: 25rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #11192D;

				input {
					font-family: PingFang SC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #11192D;
				}

			}
		}
	}
</style>